package cn.com.zcode.exam.dao;

import java.util.Collection;
import java.util.List;

import cn.com.zcode.core.dao.BaseDao;
import cn.com.zcode.exam.model.Answer;
import cn.com.zcode.exam.model.Examination;
import cn.com.zcode.exam.model.Option;
import cn.com.zcode.exam.model.Paper;
import cn.com.zcode.exam.model.Question;
import cn.com.zcode.exam.model.StaticInfo;
import cn.com.zcode.exam.model.Wrong;
import cn.com.zcode.user.model.User;

public interface ExamDao extends BaseDao {
	 
	public List<Question> listQuestions(String pmp);

	public Paper getPaperById(String pid);

	public  List<Paper> listPapersInfo(String key, String userid) ;

	public Wrong getWrong(String userId,String questionId);

	public List<Question> findMyWrongQuestionsByType(String type,String userId);

	public List<StaticInfo> listStaticInfoByType(String string);
	
	public Paper getPaper(String type, String title, int state, String userid);

	public List<StaticInfo> getPaperInfo(String type);

	public List<Question> searchQuestions(String keyword, String userId);

	public Question getQuestion(String id);

	public Question addQuestion(Question question);

	public List<Examination> listExamination(String key, String userid);

	public List<Question> listNewExamQuestions(String pid);

	public List<Question> listLastExamQuestions(String eid);


	
	
	
	
	public List<Paper> findPaperByUser(String string, User user);

	public Examination getLastExamination(String paperId,String userId);

	public List<Paper> findEditablePaper(String type, String id);

	/**
	 * 查找末完成的试题
	 * @param eid
	 * @param start
	 * @param unsubmitId
	 * @return
	 */
	public List<Question> findRemainingQuestions(String eid, int length, String[] out);


	/**
	 * 指定ID保存对象
	 * @param id
	 * @param paper
	 */
	public void savePaper(String id, Paper paper);

	/**查找错题
	 * @param eid
	 * @param start
	 * @param unsubmitId
	 * @return
	 */
	public List<Question> findRemainingWrongQuestions(String eid, int length, String[] out);

	/**
	 * 结束考试
	 * @param eid
	 * @param state
	 * @param score
	 */
	//public void saveFinishExamination(String eid, int state, double score);

	public List<Answer> getAllAnswers(String eid);

	/**
	 * 取所有错题数 
	 * @param paperId
	 * @return
	 */
	public int getWrongQuestionsCount(String eid);

	/**取所有题数
	 * @param paperId
	 * @return
	 */
	public int getQuestionsCount(String eid);

	/**
	 * @param eid
	 * @return
	 */
	List<Answer> findDoneAnswers(String eid);

	public List<Option> findOptionsByQids(Collection<String> ids);

	public List<Question> findAccessoriesByQids(Collection<String> ids);

	public List<Question> getDoneInfo(String eid,boolean iswrongInfo);

	
}
